{extend name="index/base" /}
{block name="style"}{/block}
{block name="body"}
<form class="layui-form"> 
  <div class="layui-form-item">
    <label class="layui-form-label">所属角色：</label>
    <div class="layui-input-block">
      <select name="group" lay-filter="parent" lay-verify="required" multiple="multiple">
      <option value="">请选择...</option>
      {volist name="groupdata" id="vo"}
        <option value="{$key}" {if condition="in_array($key,(array)$groupids)"}selected{/if} >{$vo|html}</option>
      {/volist}
      
      </select>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">用户名：</label>
    <div class="layui-input-inline">
      <input type="text" name="row[username]" value="{$row.username}" placeholder="" autocomplete="off" class="layui-input" lay-verify="required">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">昵称：</label>
    <div class="layui-input-inline">
      <input type="text" name="row[nickname]" value="{$row.nickname}" placeholder="" autocomplete="off" class="layui-input" lay-verify="required">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">密码：</label>
    <div class="layui-input-inline">
      <input type="password" name="row[password]" value="" placeholder="" autocomplete="off" class="layui-input" {eq name="config.actionname" value="add" }lay-verify="required"{/eq}>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-block">
      <input type="radio" name="row[status]" value="1" title="正常" checked>
      <input type="radio" name="row[status]" value="0" title="禁用" >
    </div>
  </div>
  
  <input type="hidden" name="" value="" />
  <div class="layui-form-item layui-sumbtn">
	  <div class="layui-input-block">
	    <button class="layui-btn window_submit" lay-submit="" lay-filter="ajax-post" type="submit" target-form="layui-form">立即提交</button>
	    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
	  </div>
  </div>
  
</form>
{/block}

{block name="script"}
{load href="__JS__/layui-mz-min.js"}
<script type="text/javascript">
layui.use(['tool'],function(){
	var $ = layui.jquery,form=layui.form,tool=layui.tool;
	
	{if condition="$config['actionname'] eq 'edit' "}
	tool.setValue('row[status]',{$row->getData('status')});
	{/if}
	layui.selMeltiple($);
});
</script>
{/block}